#region The MIT License
// The MIT License
// 
// Copyright (c) 2011 octalforty studios
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#endregion
using System;

namespace octalforty.Staytuned.ObjectModel
{
    /// <summary>
    /// Represents a sender of a <see cref="Notification"/>.
    /// </summary>
    public class SenderDescriptor
    {
        /// <summary>
        /// Gets or sets the name of the current <see cref="SenderDescriptor"/>.
        /// </summary>
        public string Name
        { get; set; }

        /// <summary>
        /// Gets or sets the address of the current <see cref="SenderDescriptor"/>.
        /// </summary>
        /// <remarks>
        /// <see cref="Address"/> can be <c>null</c>.
        /// </remarks>
        public Address Address
        { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="SenderDescriptor"/> class.
        /// </summary>
        public SenderDescriptor()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SenderDescriptor"/> class.
        /// </summary>
        /// <param name="name"></param>
        public SenderDescriptor(string name)
        {
            Name = name;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SenderDescriptor"/> class.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="address"></param>
        public SenderDescriptor(string name, Address address)
        {
            Name = name;
            Address = address;
        }

        /// <summary>
        /// Initializes a new instance of <see cref="SenderDescriptor"/> class with a given <paramref name="name"/>.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static implicit operator SenderDescriptor(string name)
        {
            return new SenderDescriptor(name);
        }
    }
}
